package com.performanceManagement.service.impl;

import com.performanceManagement.dao.EmployeeInformationDao;
import com.performanceManagement.pojo.EmployeeInformation;
import com.performanceManagement.service.EmployeeInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional  //开启传输流
public class EmployeeInformationServiceImpl implements EmployeeInformationService {
    @Autowired
    EmployeeInformationDao employeeInformationDao;

    /**
     * 通过部门名称查询员工
     * @param eDepartment
     * @return 员工信息列表
     */
    @Override
    public List<EmployeeInformation> queryByEDepartment(String eDepartment) {

        List<EmployeeInformation> employeeInformations = this.employeeInformationDao.findByEDepartment(eDepartment);
        return employeeInformations;
    }

    /**
     * 通过员工名查询员工
     * @param eName
     * @return
     */
    @Override
    public List<EmployeeInformation> queryByEName(String eName) {
        List<EmployeeInformation> employeeInformations = this.employeeInformationDao.findByEName(eName);
        return employeeInformations;
    }
}
